home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / CIncludes / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-08  |  635 b   |  31 lines  |  [TEXT/MPS ]

  1. /*
  2.     StdArg.h -- Variable arguments
  3.     
  4.     Copyright Apple Computer,Inc.    1987, 1990, 1994
  5.     All rights reserved.
  6.  
  7. */
  8.  
  9.  
  10. #ifndef __STDARG__
  11. #define __STDARG__
  12.  
  13. #ifndef __va_list__
  14. #define __va_list__
  15. typedef char *va_list;
  16. #endif
  17.  
  18. #ifndef __SC__
  19.     /*    most normal compilers are long-word aligned…  */
  20.     #define va_start(ap, parmN) ap = (va_list)((unsigned int)&(parmN) + (((sizeof(parmN)+3)/4)*4))
  21. #else
  22.     /*    …but Symantec C is word aligned.  */
  23.     #define va_start(ap, parmN) ap = (va_list)((char*)&parmN + (((sizeof(parmN)+1)/2)*2))
  24. #endif
  25.  
  26. #define va_arg(ap, type) ((type *)(ap += sizeof (type)))[-1]
  27. #define va_end(ap)    /* do nothing */
  28.  
  29.  
  30. #endif
  31.